package cn.xy.ymcc.feign;

import cn.xy.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFileFeignClientFallBackFactory implements FallbackFactory<MediaFileFeignClient> {

    @Override
    public MediaFileFeignClient create(Throwable throwable) {

        return new MediaFileFeignClient() {
            @Override
            public JSONResult searchMediaFiles(Long chapterId) {
                throwable.printStackTrace();
                return JSONResult.error("媒体服务不可达");
            }
        };
    }
}
